package com.huage.courseplatform.application.controller;

import cn.dev33.satoken.annotation.SaCheckRole;
import cn.dev33.satoken.annotation.SaIgnore;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huage.courseplatform.application.model.dto.BusinessManageDTO;
import com.huage.courseplatform.application.model.dto.NoticeDTO;
import com.huage.courseplatform.application.model.entity.Business;
import com.huage.courseplatform.application.model.entity.Notice;
import com.huage.courseplatform.application.model.param.BusinessManagePARAM;
import com.huage.courseplatform.application.model.param.NoticePARAM;
import com.huage.courseplatform.application.service.BusinessService;
import com.huage.courseplatform.application.service.NoticeService;
import com.huage.courseplatform.framework.api.BaseController;
import com.huage.courseplatform.framework.model.param.PagePARAM;
import com.huage.courseplatform.framework.utils.ResultUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/notice")
@Api(tags = "轮播图模块")
@Slf4j
@SaCheckRole("ROLE_ADMIN")
public class NoticeController extends BaseController<Notice, NoticeDTO, NoticePARAM, NoticeService> {

    @Override
    @ApiOperation(value = "分页查询")
    @PostMapping(value = "/page")
    @SaIgnore
    public ResultUtils<Page<NoticeDTO>> getByPage(@Validated  @RequestBody PagePARAM pagePARAM) throws IllegalAccessException {
        return super.getByPage(pagePARAM);
    }
}
